// 引入
import request from '@/utils/http/request_product';
import {
  Category1ListModel,
  Category2ListModel,
  Category3ListModel,
} from './model/categoryModel';

// 获取一级分类数据
export const getCategory1ListApi = () => {
  return request.get<any, Category1ListModel>(`/admin/product/getCategory1`);
};

// 获取二级分类数据
export const getCategory2ListApi = (category1Id: number) => {
  return request.get<any, Category2ListModel>(
    `/admin/product/getCategory2/${category1Id}`
  );
};

// 获取三级分类数据
export const getCategory3ListApi = (category2Id: number) => {
  return request.get<any, Category3ListModel>(
    `/admin/product/getCategory3/${category2Id}`
  );
};
